fix linting errors, fix electron vite popping up index.html, docs typescript errors, etc.#2265
fix linting errors, fix electron vite popping up index.html, docs typescript errors, etc.#2265
Conversation
…escript errors, etc.
|
Caution Review failedThe pull request is closed. Walkthrough
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (4)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
docs/src/components/platformcontext.tsx (1)
49-55: React.FC already includes children; this generic doesn’t make children requiredIf the goal is stronger typing, declaring the function with an explicit props type avoids the React.FC children optionality. Otherwise, you can keep it as-is.
Apply this minimal change to make
childrenrequired and remove the redundant generic:-export const PlatformProvider: React.FC<{ children: ReactNode }> = ({ children }) => { +export const PlatformProvider = ({ children }: { children: ReactNode }) => {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
.vscode/settings.json(1 hunks)docs/docs/config.mdx(1 hunks)docs/src/components/platformcontext.tsx(1 hunks)electron.vite.config.ts(2 hunks)
🧰 Additional context used
🪛 LanguageTool
docs/docs/config.mdx
[grammar] ~7-~7: There might be a mistake here.
Context: ...{ Kbd } from "@site/src/components/kbd"; import { PlatformProvider, PlatformSelec...
(QB_NEW_EN)
🔇 Additional comments (4)
electron.vite.config.ts (2)
30-32: Explicitly disabling auto-open for main dev server looks goodThis aligns behavior across targets and helps avoid the stray browser window when developing.
53-55: Consistent dev server behavior for preload as wellMirrors the renderer config and prevents unwanted browser tabs in dev. Good call.
docs/docs/config.mdx (1)
7-8: Import path cleanup LGTMDropping explicit
.tsxextensions improves compatibility with MDX/TS resolution and avoids editor/type tooling friction. No issues spotted..vscode/settings.json (1)
58-59: Staticcheck setup looks reasonableUsing staticcheck with targeted suppressions aligns with the stated “fix linting errors” objective.
| "gopls": { | ||
| "analyses": { | ||
| "QF1003": false | ||
| } |
There was a problem hiding this comment.
💡 Verification agent
🧩 Analysis chain
Confirm whether gopls recognizes the QF1003 analysis key
I’m not certain gopls.analyses.QF1003 is a supported key (staticcheck uses QF1003, but gopls analyses are typically names like unusedparams, nilness, etc.). If unsupported, gopls will ignore it silently.
Please run this quick web check to confirm support and the recommended way to suppress QF1003 in VS Code:
🌐 Web query:
Does gopls support an analyses key named "QF1003" in settings.json? What’s the recommended way to disable Staticcheck rule QF1003 in VS Code (golang.go + staticcheck)?
💡 Result:
Short answer: Yes — gopls exposes a QF1003 analyzer name and you can disable it. The recommended way in VS Code (with the official Go extension / gopls) is to turn that analyzer off in your gopls settings (settings.json). (tip.golang.org, github.com)
How to do it (recommended)
-
In VS Code open Settings → Open Settings (JSON) and add a gopls UI diagnostic analyses entry to disable QF1003. For example (user or workspace settings.json):
{
"gopls": {
"ui": {
"diagnostic": {
"analyses": {
"QF1003": false
},
"staticcheck": true
}
}
}
}
This tells gopls to stop reporting the QF1003 quickfix. After changing the setting reload VS Code / restart the language server. (github.com, go.dev)
Other options (if they apply)
-
If you run staticcheck separately (CLI, CI, or via golangci-lint), disable QF1003 in staticcheck’s config by adding a minus entry to the checks list in staticcheck.conf (TOML). Example staticcheck.conf:
checks = ["all", "-QF1003"]
Staticcheck also supports project-wide config and will ignore checks configured in staticcheck.conf. (staticcheck.dev)
- Per-line or per-file: you can silence a specific occurrence with staticcheck linter directives in the source:
- Line: //lint:ignore QF1003 reason
- File: //lint:file-ignore QF1003 reason
These are useful for individual exceptions. (staticcheck.dev)
Notes / caveats
- gopls ships its own set of analyzers (including the QF quickfixes). The analyses map (and the vscode-go UI.diagnostic.analyses mapping) is the preferred way to tune what gopls reports in the editor. If you also enable staticcheck as a separate tool or via golangci-lint, disable the check there too (or use the staticcheck.conf) to keep behavior consistent. (tip.golang.org, staticcheck.dev)
If you want, tell me whether you want the setting applied globally or only for the workspace and I can produce the exact JSON snippet to paste into your settings.json (or the TOML for staticcheck.conf).
Citations:
- 1: https://tip.golang.org/gopls/analyzers.md?utm_source=chatgpt.com
- 2: https://github.com/golang/vscode-go/wiki/settings?utm_source=chatgpt.com
- 3: https://github.com/golang/vscode-go/wiki/settings?utm_source=chatgpt.com
- 4: https://go.dev/gopls/settings?utm_source=chatgpt.com
- 5: https://staticcheck.dev/docs/configuration?utm_source=chatgpt.com
- 6: https://staticcheck.dev/docs/configuration?utm_source=chatgpt.com
- 7: https://tip.golang.org/gopls/analyzers.md?utm_source=chatgpt.com
- 8: https://staticcheck.dev/docs/configuration?utm_source=chatgpt.com
Update gopls settings to disable QF1003 in the correct section
The QF1003 analyzer is valid, but gopls expects it under gopls.ui.diagnostic.analyses, not directly under gopls.analyses. As written, your setting will be ignored.
Please adjust your VS Code settings.json to something like:
.vscode/settings.json
@@
- "gopls": {
- "analyses": {
- "QF1003": false
- }
- }
+ "gopls": {
+ "ui": {
+ "diagnostic": {
+ "analyses": {
+ "QF1003": false
+ },
+ "staticcheck": true
+ }
+ }
+ }• After updating, reload VS Code or restart gopls to apply.
• If you also run staticcheck standalone, remember to disable QF1003 there (e.g. in staticcheck.conf: checks = ["all", "-QF1003"]). 1
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "gopls": { | |
| "analyses": { | |
| "QF1003": false | |
| } | |
| "gopls": { | |
| "ui": { | |
| "diagnostic": { | |
| "analyses": { | |
| "QF1003": false | |
| }, | |
| "staticcheck": true | |
| } | |
| } | |
| } |
🤖 Prompt for AI Agents
.vscode/settings.json around lines 60-63: the QF1003 analyzer is currently
placed under "gopls.analyses" which gopls ignores; move the setting into
"gopls.ui.diagnostic.analyses" as "QF1003": false so gopls will apply it, save
the file and reload VS Code or restart gopls to take effect, and if you run
staticcheck separately also disable QF1003 there (e.g. in staticcheck.conf use
checks = ["all", "-QF1003"]).
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
frontend/app/view/preview/directorypreview.tsx (2)
669-692: Duplicate React keys across top and center row listsBoth maps use key={idx}; since each map starts at 0, keys collide when at least one row is pinned at the top. Use a stable unique key (row.id is ideal) to avoid reconciliation bugs and warnings.
- {table.getTopRows().map((row, idx) => ( + {table.getTopRows().map((row, idx) => ( <TableRow model={model} row={row} focusIndex={focusIndex} setFocusIndex={setFocusIndex} setSearch={setSearch} idx={idx} handleFileContextMenu={handleFileContextMenu} - key={idx} + key={row.id} /> ))} - {table.getCenterRows().map((row, idx) => ( + {table.getCenterRows().map((row, idx) => ( <TableRow model={model} row={row} focusIndex={focusIndex} setFocusIndex={setFocusIndex} setSearch={setSearch} - idx={idx + table.getTopRows().length} + idx={idx + table.getTopRows().length} handleFileContextMenu={handleFileContextMenu} - key={idx} + key={row.id} /> ))}
507-508: MakeosRefprop optional/nullable inTableBodyProps
osRef.currentcan beundefinedon first render and is guarded at runtime—update the prop type to reflect that and avoid TS errors under strict null checks.• File:
frontend/app/view/preview/directorypreview.tsx
In theTableBodyPropsinterface (around lines 504–508), change:- osRef: OverlayScrollbarsComponentRef; + osRef?: OverlayScrollbarsComponentRef | null;
🧹 Nitpick comments (3)
frontend/app/view/preview/directorypreview.tsx (3)
526-556: Scroll-to-focused-row logic is solid; tighten types and minor nitsNice simplification with DOM lookup and precise viewport math. A few small improvements to avoid TS issues and future bugs:
- The null check for focusIndex is redundant (type is number). Either remove it or widen the type.
- Prefer the generic overload of querySelector to avoid a cast.
- Add osRef to the effect deps to avoid stale refs if the overlay instance changes.
- Optional: useLayoutEffect here to eliminate potential flicker when jumping focus.
Suggested patch:
- if (focusIndex === null || !bodyRef.current || !osRef) { + if (!bodyRef.current || !osRef) { return; } - - const rowElement = bodyRef.current.querySelector(`[data-rowindex="${focusIndex}"]`) as HTMLDivElement; + const rowElement = bodyRef.current.querySelector<HTMLDivElement>( + `[data-rowindex="${focusIndex}"]` + ); if (!rowElement) { return; } @@ - }, [focusIndex]); + }, [focusIndex, osRef]);
386-402: Avoid stale pins and use strict equality when pinning the “..” rowClear any previous pin state before pinning the parent row to prevent stale/duplicate pinned ids across directory changes. Also, use strict equality.
- let foundParentDir = false; + let foundParentDir = false; for (const row of rows) { - if (row.getValue("name") == "..") { - row.pin("top"); + if (row.getValue("name") === "..") { + // Clear any stale pins before pinning the parent row + table.resetRowPinning(); + row.pin("top"); foundParentDir = true; break; } } // If we didn't find the ".." row, reset the pinning to avoid stale references if (!foundParentDir) { table.resetRowPinning(); }
762-764: Use strict equality in the MemoizedTableBody comparatorMinor lint/readability nit: prefer === for the memo comparator.
- (prev, next) => prev.table.options.data == next.table.options.data + (prev, next) => prev.table.options.data === next.table.options.data
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
frontend/app/view/preview/directorypreview.tsx(3 hunks)
🔇 Additional comments (1)
frontend/app/view/preview/directorypreview.tsx (1)
737-739: Using data-rowindex to target rows: LGTMThis aligns the scroll logic with a simple, robust DOM query and removes ref churn. The index mapping also matches DirectoryTable’s allRows composition.
No description provided.